UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L0c5DShJW2Rhin2yezNFlNzmHKGGqyZTPvwQALu1Zi0=' 
WHERE 
  key_id = 'cb92bbc12ca5d51b7f8618784a3a4cba120571699b33ab2799190c13206f9ec5' 
  AND (
    token = 'L0c5DShJW2Rhin2yezNFlNzmHKGGqyZTPvwQALu1Zi0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021