UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ehW8ETzVLmi7uBCp/LR1CwowUUAKPhoF2S0S1NVBwpM=' 
WHERE 
  key_id = 'c4f4114ee8e5c304f6a646a6aa08f45626ba8f6cc7ed2412adb54ed423181d19' 
  AND (
    token = 'ehW8ETzVLmi7uBCp/LR1CwowUUAKPhoF2S0S1NVBwpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015