UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AFb8xu/KVbCmDMOwJF1LYMwX/irmEVDpK6+5Aj+tHwQ=' 
WHERE 
  key_id = '63c98f9afb52df48f5d53ee2f8fdbc41c5ba45e57cb7a71d3afa4c41bafc75a1' 
  AND (
    token = 'AFb8xu/KVbCmDMOwJF1LYMwX/irmEVDpK6+5Aj+tHwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023