UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o4mzXVpCl+5Y2mSvYz/EWDXKhinmyVRlrL79VxwjInU=' 
WHERE 
  key_id = 'e164c951eaf3a4a341e2bbb5f78c5a0e02754fdbc891e175075fa0f660609c34' 
  AND (
    token = 'o4mzXVpCl+5Y2mSvYz/EWDXKhinmyVRlrL79VxwjInU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039