UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qhCpJB5bfDqSIw/mfsyvjvFn1qhtsfU0dcM1dVh+A+A='
WHERE
key_id = 'fe603b2841985f7614d173b9b3e9e771048a6d98eff98a78e219fc1fac84c598'
AND (
token = 'qhCpJB5bfDqSIw/mfsyvjvFn1qhtsfU0dcM1dVh+A+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)