UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cnwcAWsNhCpGBJOgtfHOS45y0cyl+SH3ZlLKcG2gY4Q='
WHERE
key_id = '2e7855977b85a757d1683f17ddfe556788e679427b4f6a2c119c3a8ab2e5e8c3'
AND (
token = 'cnwcAWsNhCpGBJOgtfHOS45y0cyl+SH3ZlLKcG2gY4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)