UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2ffRnghgaw5d/6pFPBqaPOj6B9Cyqh/Z7YL1TEn8JLk=' 
WHERE 
  key_id = 'a080290b76ad80f9a00d960fd0b1b446c10ca0d20254e80053882d5d616560e4' 
  AND (
    token = '2ffRnghgaw5d/6pFPBqaPOj6B9Cyqh/Z7YL1TEn8JLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028