UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NeyKnWcjb06SW+OS9IsgxYzPOW8HMbUZ8cBg6tdxYEs=' 
WHERE 
  key_id = 'edd0fc99158ab99d5face4f66349319ee2343b38a89b253f865d33697aba9ea9' 
  AND (
    token = 'NeyKnWcjb06SW+OS9IsgxYzPOW8HMbUZ8cBg6tdxYEs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017