UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qUUYFn/WzMWIxj9aK6xW+u1xT3rUVkfP6DqTGCFzz/o=' 
WHERE 
  key_id = 'b1bf10ec1485eba40fc511b23ee9d4c0e4e408dab7fe07c574d082ad0b6d584e' 
  AND (
    token = 'qUUYFn/WzMWIxj9aK6xW+u1xT3rUVkfP6DqTGCFzz/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021