UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iQ9bDqvLyW9lm8luM1dr0wMiKn5igcagK5EFJ5Sx85U='
WHERE
key_id = '832bd12a42fb337eab1d8fdf44f9a2245da9bb5b857f6aa39c3d1ba443280aaa'
AND (
token = 'iQ9bDqvLyW9lm8luM1dr0wMiKn5igcagK5EFJ5Sx85U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)