UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Jl/YApxGa7RR6MMsdpTBjK3KDB+s3QDD6DWM2YwlK4='
WHERE
key_id = '4bf2d49a77bcc57c5a37e44282aaf60d5a87127bbee11c1778b3313ad3932361'
AND (
token = '0Jl/YApxGa7RR6MMsdpTBjK3KDB+s3QDD6DWM2YwlK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)