UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dmNfeSKnRKsI4TL2oYma/KzD697rItkXc0h0JaSgRWw=' 
WHERE 
  key_id = '6d8360b7e3c6468a06a8a1b2762d78c3f28c3f9d4f7e4aa34bf54c9fe23e99c3' 
  AND (
    token = 'dmNfeSKnRKsI4TL2oYma/KzD697rItkXc0h0JaSgRWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039