UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VKetSnmUIbsSvLOsacGj3HmtLObyhzL7GELdqkWg3t8=' 
WHERE 
  key_id = '6fe208b1bbdd71eab65c6aa836ee73beafa9cd787fe768c417d32958cbd5cbe0' 
  AND (
    token = 'VKetSnmUIbsSvLOsacGj3HmtLObyhzL7GELdqkWg3t8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042