UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y43pMpVmgolk6YhvSlwfRJGqyY8lkXA+TazlYtRZsiA='
WHERE
key_id = '2bfdab46f465a0246ec0bb593ccff0166bbcf47d0ad7a562339c0f73a9cfe95f'
AND (
token = 'y43pMpVmgolk6YhvSlwfRJGqyY8lkXA+TazlYtRZsiA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)