UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VwIvA0dn4g1W6qxd1IPbABgcnlRNSGC4F3/61PeLmkY=' 
WHERE 
  key_id = '255f6c493054cf8a4ee3af6c180c4e390289586adc30c388dc662483a070bbd4' 
  AND (
    token = 'VwIvA0dn4g1W6qxd1IPbABgcnlRNSGC4F3/61PeLmkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036