UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+jSrA1j/8Xu+XH2grw7Sgx5WjLJNgpAj9roMLWfSvdo='
WHERE
key_id = '87ab2260573449a0cfd7b2959eda011f60cbacda9343ac49e3992eff8d9a4cbe'
AND (
token = '+jSrA1j/8Xu+XH2grw7Sgx5WjLJNgpAj9roMLWfSvdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)