UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9XEheHWEdgGA46DoQ+rLGuSfkh6s3qbsilzD04vT3y8='
WHERE
key_id = '58abb3f3e7939565458e1879c94db6834b23ae60473747dceb4783126fd28e19'
AND (
token = '9XEheHWEdgGA46DoQ+rLGuSfkh6s3qbsilzD04vT3y8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)