UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LSz2h6YR4sZbIOAc6/5U3wgJ/sp8+NlUi6DVLM1uSJw='
WHERE
key_id = '1d47f83657cd372f5e92d85a0430ac53f9a5d74f26b2e1c17e21a92dc907ece0'
AND (
token = 'LSz2h6YR4sZbIOAc6/5U3wgJ/sp8+NlUi6DVLM1uSJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)