UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vz60juhHfQQKEyIwNYgJaEF9CYvOYdAFFSIlSYLs9rs='
WHERE
key_id = 'ee56a901eb91b69dcc8e083a7ff9f62e52ef4c15b97fed5688c8287941832d19'
AND (
token = 'Vz60juhHfQQKEyIwNYgJaEF9CYvOYdAFFSIlSYLs9rs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)