UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eIdFNfrSNJ8E4goND15W/9TtskWt4FwoKMRSkViDc7M=' 
WHERE 
  key_id = 'ca4c44eaa9bc3600ce4a2d077e33719da37af48e79a3fc89f3e567c425891f4c' 
  AND (
    token = 'eIdFNfrSNJ8E4goND15W/9TtskWt4FwoKMRSkViDc7M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025