UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ljtHili3noeRHeV/iAB23yhIZnC/B9uZRbmiT8vaogo='
WHERE
key_id = '7cb1502a394e5eea3bd30beda2e013ce854649f7bc073688ecc0d8ba099f4f98'
AND (
token = 'ljtHili3noeRHeV/iAB23yhIZnC/B9uZRbmiT8vaogo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)