UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xdZSYOV3lQgQNhLW4PREo+IQl9l46K6jfDhS5tPG9dQ=' 
WHERE 
  key_id = '3a03a4249fab4ff3095753f0b1e8a5199e8c914963eeed82fbb896d9eab5648a' 
  AND (
    token = 'xdZSYOV3lQgQNhLW4PREo+IQl9l46K6jfDhS5tPG9dQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027