UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5YSXh2Bu5UwUydU6c2noakGLib1PaCznsDW/jWREAhM='
WHERE
key_id = '39a24211656d5259f26980ea566034e72258500ceb269ad6f2df963dd794abf6'
AND (
token = '5YSXh2Bu5UwUydU6c2noakGLib1PaCznsDW/jWREAhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)