UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KQph+z9/VsrDlG1XLiDYQ0IZhS7KXHN00+bUkkwxx5s='
WHERE
key_id = '8e5b44ed2901239c40fe5881e3d97626ff3724d4991967b532a641920d20376b'
AND (
token = 'KQph+z9/VsrDlG1XLiDYQ0IZhS7KXHN00+bUkkwxx5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)