UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YtD+spjlamFDWNsOid535MMe8RI2lGdYXAbBvO9IQDc=' 
WHERE 
  key_id = '314a9ffba2e831c4ce8eb6ea8676aba7e30103c4852fcfd701b33679791a5cdb' 
  AND (
    token = 'YtD+spjlamFDWNsOid535MMe8RI2lGdYXAbBvO9IQDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033