UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3vGpyOUPzelSCXkKcXD/z5/vICYC7hwMwSoE4yvWrBs=' 
WHERE 
  key_id = 'c94201b74eb413bb19d815a338b4a87510e1a7c5884798520c85e8a51d6e1ee8' 
  AND (
    token = '3vGpyOUPzelSCXkKcXD/z5/vICYC7hwMwSoE4yvWrBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044