UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zmRdisuV/51L0z5HkFpibiy9CZvghUwn6AaPHIMuuWU=' 
WHERE 
  key_id = '8f3fd739321f64578dd4a528276492e88e4478a9f784bf27f87c52454608b1f5' 
  AND (
    token = 'zmRdisuV/51L0z5HkFpibiy9CZvghUwn6AaPHIMuuWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044