UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K+doOqcrwX7yLmGamRXGkO/rTHilP+QaHfLcbx9Oc4I='
WHERE
key_id = '84d3ebd88b2cf49c6acf6b8f4b0618a1f8b8a1615dbec5a0d592c45bcd38b533'
AND (
token = 'K+doOqcrwX7yLmGamRXGkO/rTHilP+QaHfLcbx9Oc4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)