UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qxoreFFaT+8SI7T9b7B5q1xPs8dOBG1dbcXTZekOwUY='
WHERE
key_id = '0cf3eccd1166d17c66b5eec4c89d0f3bca935ba52921cd7cd9b5526161161dce'
AND (
token = 'qxoreFFaT+8SI7T9b7B5q1xPs8dOBG1dbcXTZekOwUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)