UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hGeVa0DhN2g7RgA6VJANm8fD4mJOBoHkUPt9wb1mTrI='
WHERE
key_id = '63a790cb09440c06bceb5afdd4c083aba2c090eac4060550359c885f8329cb47'
AND (
token = 'hGeVa0DhN2g7RgA6VJANm8fD4mJOBoHkUPt9wb1mTrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)