UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7vgCrcvnarRQ7KreDkeCWSXzXCW6dwXEPKBv8kmy4Q4=' 
WHERE 
  key_id = '1754334e031954b11ea416f0d1b1492c8a59db90f8704d7925d26662e9b52a63' 
  AND (
    token = '7vgCrcvnarRQ7KreDkeCWSXzXCW6dwXEPKBv8kmy4Q4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028