UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mCQDRXRPiS+cOMU4LDjmIIP1KoTa+UINhHdlz4JLBi0='
WHERE
key_id = '458f85d859e2121b947203993b5ef82211c68096e277dfd6fbf714de971b496e'
AND (
token = 'mCQDRXRPiS+cOMU4LDjmIIP1KoTa+UINhHdlz4JLBi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)