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