UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KdGdH7q63rau9u/tcIqM1cdkRLZklEHM0zRZG57JLSg='
WHERE
key_id = '21edb320d6d5c91413b79f1c05fb0414ecffcc2827a78d4d0f0ff8c2188f0895'
AND (
token = 'KdGdH7q63rau9u/tcIqM1cdkRLZklEHM0zRZG57JLSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)