UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'txaRablYyZDIOoML6tpSiSJvly3ouoNGpBjUUj50+MI=' 
WHERE 
  key_id = '28f0707f7542ef40b2db1c9a45e8ee6ec87876b605d00fd94c8687cd39e1d6e0' 
  AND (
    token = 'txaRablYyZDIOoML6tpSiSJvly3ouoNGpBjUUj50+MI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016