UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'arBhX4RWow2GK1J3xbXGDufDagXKdhoYzSvsgxsyxlY=' 
WHERE 
  key_id = '1d3bae272bf7e61efd5c907fa794a9130554b9c5c63bf3b9874eaa74eeb31bc2' 
  AND (
    token = 'arBhX4RWow2GK1J3xbXGDufDagXKdhoYzSvsgxsyxlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028