UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SZF0o0iUU/1tKMRHu/ic+ZQylQyxAgRk3rKaJ6sixD0='
WHERE
key_id = '4ae0f5c5714051499f1ca224a0cb687a1effda15c28d5c4a8fe65b1de84906b9'
AND (
token = 'SZF0o0iUU/1tKMRHu/ic+ZQylQyxAgRk3rKaJ6sixD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)