UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sUrfRuBOINLzLRWEI/M4llpyPVkTiS6bQI7Trqj5WUM='
WHERE
key_id = 'ffe011051d7eb9ff08fad13fab42a0aa3252db1d6f80d2987d129ea8c785ab1e'
AND (
token = 'sUrfRuBOINLzLRWEI/M4llpyPVkTiS6bQI7Trqj5WUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)