UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eZ3hH+bDa2InmA7B7cdyJ+vi4EUknC32Rt1KUIHAWjo='
WHERE
key_id = '9d43c50e4a66533c1961071c63fd56c3e0469a41165735202cd067afaa4fc57c'
AND (
token = 'eZ3hH+bDa2InmA7B7cdyJ+vi4EUknC32Rt1KUIHAWjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)