UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aRM9YdqLTIAkP8SLPvcwZEkfI2BKSbDwTO/SURw9630=' 
WHERE 
  key_id = 'b9602d8b1e5d0b3f9d9650d4c87e5de284fdd421e8de5961e0b7e0ca1a460fff' 
  AND (
    token = 'aRM9YdqLTIAkP8SLPvcwZEkfI2BKSbDwTO/SURw9630=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031