UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PIKLwPseB4kSL/yfQkZl6pFwxuaR1/rtxfYz5X/nfUg='
WHERE
key_id = '804c0d2956bf7bfdbdc47e9ece3718fae81a5c1cfc3cfccea3da20deb2892e5a'
AND (
token = 'PIKLwPseB4kSL/yfQkZl6pFwxuaR1/rtxfYz5X/nfUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)