UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UUfTtgsqs3Q+cucqSESnp6ihW8OhEGrXTRxTajcnF6M='
WHERE
key_id = '72f341aff31f2d344fd86578e6af5e4784fd47032ccfd8f2cacaa877dc4500f3'
AND (
token = 'UUfTtgsqs3Q+cucqSESnp6ihW8OhEGrXTRxTajcnF6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)