UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b+74+87R6NoKA/lQmBxy1Ep2CsbMFnCiqpeR5QxWoSI='
WHERE
key_id = '294e9e7ade70eec1a47c7878590ce190d7ff272b0cbfb8ed76176f82bb911aa4'
AND (
token = 'b+74+87R6NoKA/lQmBxy1Ep2CsbMFnCiqpeR5QxWoSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)