UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jhg8E7cPzqSmCEQrj43yUUSEdn153GXdfW2Xg+MxKr4='
WHERE
key_id = '441fa0e193c25fb1600a51492fc8e28fe2d76ec222a199421685b19c94a355f3'
AND (
token = 'jhg8E7cPzqSmCEQrj43yUUSEdn153GXdfW2Xg+MxKr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)