UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GgpmqPuU/9YR1Jl47L+uW+wIpV7jk4FRiFSGgGkq+d8='
WHERE
key_id = '9f61bca13d6a54b7f540797bff2dbc0e730e8f758d1be8401ebc8a5fb3592b64'
AND (
token = 'GgpmqPuU/9YR1Jl47L+uW+wIpV7jk4FRiFSGgGkq+d8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)