UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QvUPzejaweeEeXBP/c58fVz2r8TqY9GaEqwvF++DOVg=' 
WHERE 
  key_id = '6a448a0f1c9ba8d9cfdc8af22981142628993ee2730901bc18b34c3ee5e38224' 
  AND (
    token = 'QvUPzejaweeEeXBP/c58fVz2r8TqY9GaEqwvF++DOVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043