UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jLOn2TddOx9wQOsAn9azqHkY5+7/L4ZRhn13ydfd0wY='
WHERE
key_id = 'dbd663dd6c7636cd5872fc1442b2b3109a9626de1664f97f5557459fc4d54e0f'
AND (
token = 'jLOn2TddOx9wQOsAn9azqHkY5+7/L4ZRhn13ydfd0wY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)