UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3kEOUYAh4tGXL/iSPDXOSd0VSfZY/c27X58OGU2JGKA='
WHERE
key_id = '46374da5c19e7384243a1d919a7710ccc2388bbc28fe126e2c1f866aca55567e'
AND (
token = '3kEOUYAh4tGXL/iSPDXOSd0VSfZY/c27X58OGU2JGKA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)