UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aDKvdkb0McvWpLkvmZ6mCIdcWEr43QtrkkEkIwh/UMI='
WHERE
key_id = '9692f83f32f1b0ee8f5010d67da301c4ea6a285e64ee85a3745c851945dd89a1'
AND (
token = 'aDKvdkb0McvWpLkvmZ6mCIdcWEr43QtrkkEkIwh/UMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)