UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'itmTKKYeE2fQMBeWxOUR9L26e8P2WzNdL9wtJ9Wkx1I='
WHERE
key_id = '116cc4bbde67e498fcade3b74d62ae4eece9adbae75bf5a4fa931eb2cd802aed'
AND (
token = 'itmTKKYeE2fQMBeWxOUR9L26e8P2WzNdL9wtJ9Wkx1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)