UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BnSjnGyNfvwzvGsCF7q3t7O5LQgs2hPUvprUpT+SIAY='
WHERE
key_id = '65b2ac4f16746a9aabb4cb2f120bafe2b70836c02bd61fada604fb5855400e45'
AND (
token = 'BnSjnGyNfvwzvGsCF7q3t7O5LQgs2hPUvprUpT+SIAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)