UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sxDUchCkf4fukFU1I5q/j4+SEI8UvysE6OGe7I9S2B0='
WHERE
key_id = 'faa9a2eca1169ee2fffe1ee73fc16c79bad88fc1cd6c2e74b70d422e25ac43f3'
AND (
token = 'sxDUchCkf4fukFU1I5q/j4+SEI8UvysE6OGe7I9S2B0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)