UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jm9+f2/yYeCv23wf+tU8n6QSseBg1h2HD9rnWRVETlU=' 
WHERE 
  key_id = 'ea12c3cd3cce22fe3c963761b1760ddb6b5124449478bfcf8ccdf8f4b447d278' 
  AND (
    token = 'jm9+f2/yYeCv23wf+tU8n6QSseBg1h2HD9rnWRVETlU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021