UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7TBIG80UOuUO0FBPk8v7JP0YeBHLFkFzNNSnXuIVhWU='
WHERE
key_id = '3a31932a7c0247da3194c5bab570bd77e912241d1f75e3d70d29dac673a32ba3'
AND (
token = '7TBIG80UOuUO0FBPk8v7JP0YeBHLFkFzNNSnXuIVhWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)